package yunwo.cn.yzstation.presenter;

import yunwo.cn.yzstation.api.IongoingModel;
import yunwo.cn.yzstation.api.IongoingView;
import yunwo.cn.yzstation.base.BasePresenter;
import yunwo.cn.yzstation.bean.InventoryBean;
import yunwo.cn.yzstation.model.OngoingModer;
import yunwo.cn.yzstation.view.activity.InventoryActivity;
import yunwo.cn.yzstation.view.fregment.inventory.OngoinggFragment;

/**
 * Created by lao on 2017/9/19.
 */
public class OngoingFragmentPersenter extends BasePresenter<yunwo.cn.yzstation.api.IongoingView> implements IongoingModel {
    private final OngoingModer mOngoingModer;
    InventoryActivity activity;
    OngoinggFragment ongoinggFragment;
    IongoingView IongoingView;


    public OngoingFragmentPersenter(InventoryActivity activity, OngoinggFragment ongoinggFragment, IongoingView iongoingView) {
        this.activity = activity;
        this.ongoinggFragment = ongoinggFragment;
        this.IongoingView = iongoingView;
        mOngoingModer = new OngoingModer(activity, this);
    }

    public void getData(String type, int pagenum, int pagesize) {
        mOngoingModer.getData(type,pagenum,pagesize);
    }

    @Override
    public void getListDataSuccess(InventoryBean.DataBean dataBean, String type) {
        IongoingView.getListDataSuccess(dataBean,type);
    }

    @Override
    public void getListDataFailure() {
        IongoingView.getListDataFailure();
    }
}
